import store from "@/store";
import dayjs from "dayjs";
console.log(88);
export const formItemStyle = {
  paddingLeft: "20px",
};

export const cellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};

// 表头单元格样式
export const headerCellStyle = {
  background: "rgba(28, 155, 252, 0.02)",
  color: "rgb(142, 155, 185)",
  textAlign: "center",
};
// 表格内表单子样式
export const tableFormStyle = {
  marginBottom: 0,
};

export const tableBase = [
  {
    label: "代码",
    prop: "code",
    width: "300",
    operate: {
      type: "input",
      field: "code",
    },
  },
  {
    label: "自提点名称",
    prop: "selfPickupPointName",
    width: 200,
    operate: {
      type: "input",
      field: "selfPickupPointName",
    },
  },
  {
    label: "首1KG佣金",
    prop: "firstOneKgCommission",
    width: 200,
    operate: {
      field: "firstOneKgCommission",
      type: "inputNumber",
      otherOptions: {
        precision: 2,
        step: 0.1,
        min: 0,
      },
    },
  },
  {
    label: "续1KG佣金",
    prop: "continueOneKgCommission",
    width: 200,
    operate: {
      type: "inputNumber",
      field: "continueOneKgCommission",
      otherOptions: {
        precision: 2,
        step: 0.1,
        min: 0,
      },
    },
  },
  {
    label: "佣金说明",
    prop: "commissionRemarks",
    width: 200,
    operate: {
      type: "input",
      field: "commissionRemarks",
    },
  },
  {
    label: "自提点地址",
    prop: "selfPickupPointAddress",
    width: 200,
    operate: {
      type: "input",
      field: "selfPickupPointAddress",
    },
  },
  {
    label: "店铺id",
    prop: "shopName",
    width: 150,
    operate: {
      type: "select",
      field: "shopId",
      optionsKey: "shopName",
      optionsValue: "id",
      options: store.state.custom_dict.shop,
    },
  },

  {
    label: "联系手机",
    prop: "contactPhone",
    width: 200,
    operate: {
      type: "input",
      field: "contactPhone",
    },
    rules: [{ reg: /^(?:(?:\+|00)86)?1[3-9]\d{9}$/ }],
  },
  {
    label: "联系人",
    prop: "contactName",
    width: 200,
    operate: {
      type: "input",
      field: "contactName",
    },
  },
  {
    label: "联系电话",
    prop: "telephone",
    width: 200,
    operate: {
      type: "input",
      field: "telephone",
    },
    rules: [{ reg: /^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/ }],
  },
  {
    label: "邮箱",
    prop: "email",
    width: 200,
    operate: {
      type: "input",
      field: "email",
    },
    rules: [
      {
        reg: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
      },
    ],
  },
  {
    label: "营业时间",
    prop: "businessHours",
    width: 200,
    operate: {
      type: "daterange",
      field: "businessHours",
      otherOptions: {
        type: "datetimerange",
      },
    },
  },
  {
    label: "是否到付",
    prop: "isToPay",
    slotName: "isToPay",
  },
  {
    label: "寄件",
    prop: "sending",
    width: 200,
    slotName: "sending",
  },
  {
    label: "是否启用",
    prop: "status",
    operate: {
      type: "switch",
      field: "status",
      otherOptions: {
        activeValue: 1,
        inactiveValue: 0,
      },
    },
  },
  {
    label: "最大重量",
    prop: "maxWeight",
    width: 200,
    operate: {
      type: "inputNumber",
      field: "maxWeight",
      otherOptions: {
        precision: 2,
        step: 0.1,
        min: 0,
      },
    },
  },
  {
    label: "地址到付费",
    prop: "addressToPay",
    width: 200,
    operate: {
      type: "inputNumber",
      field: "addressToPay",
      otherOptions: {
        precision: 2,
        step: 0.1,
        min: 0,
      },
    },
  },
  {
    //类型(0自提点 1自提柜)
    label: "类型",
    prop: "type",
    width: 200,
    operate: {
      type: "select",
      field: "type",
      optionsKey: "label",
      optionsValue: "value",
      options: [
        { label: "自提点", value: 0 },
        { label: "自提柜", value: 1 },
      ],
    },
  },
  {
    label: "仓库",
    prop: "warehouseId",
    width: 300,
    operate: {
      type: "select",
      field: "warehouseId",
      optionsKey: "warehouseName",
      optionsValue: "id",
      options: store.state.custom_dict.warehouse,
    },
  },
  {
    label: "目的地",
    prop: "destinationId",
    width: 300,
    operate: {
      type: "select",
      field: "destinationId",
      optionsKey: "destinationName",
      optionsValue: "destinationId",
      options: store.state.custom_dict.destination,
    },
  },
  {
    label: "省",
    prop: "province",
    width: 200,
    operate: {
      type: "input",
      field: "province",
    },
  },
  {
    label: "市",
    prop: "city",
    width: 200,
    operate: {
      type: "input",
      field: "city",
    },
  },
  {
    label: "区",
    prop: "region",
    width: 200,
    operate: {
      type: "input",
      field: "region",
    },
  },
  {
    label: "短信模板",
    prop: "smsTemplate",
    width: 200,
    operate: {
      type: "input",
      field: "smsTemplate",
    },
  },
  {
    label: "登录账号",
    prop: "loginAccount",
    width: 200,
  },
  {
    label: "登录密码",
    prop: "loginPassword",
    width: 200,
  },
  {
    label: "创建时间",
    prop: "createTime",
    width: 200,
  },
  {
    label: "更新时间",
    prop: "updateTime",
    width: 200,
  },
  {
    label: "创建人",
    prop: "createBy",
    width: 200,
  },
  {
    label: "修改人",
    prop: "updateBy",
    width: 200,
  },
];
